/* Copyright (c) 2007-2011 SmartVault Corporation, all rights reserved.
 * 
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
#pragma once

#include "resource.h"

#include "..\..\SDK\Include\SmartVaultSDK.h"
using namespace SmartVault;
// TestToolbarDlg dialog

class TestToolbarDlg : public CDialog// , public IContextStateMonitor
{
	DECLARE_DYNAMIC(TestToolbarDlg)
public:
	TestToolbarDlg(LPCTSTR lpContextName, LPCTSTR lpConfigFile, CWnd* pParent = NULL);   // standard constructor
	virtual ~TestToolbarDlg();

// Dialog Data
	enum { IDD = IDD_TESTTOOLBARVIEW_DIALOG };

protected:
    CString m_configName;
    CString m_contextId;
    CString m_customerCountKey;

    CButton m_btnAttach;
    CButton m_btnView;
    CButton m_btnNotes;

    CListBox m_lbItems;
    CEdit m_edtName;
    CButton m_btnSave;
    CButton m_btnCancel;

    CComPtr<ISmartVaultClientSDK> SVClient;
    CComPtr<IApplicationContext> SVContext;
    CComPtr<IContextNewItem> SVNewItem;

    void ResizeTo(int cx, int cy);

	// Generated message map functions
	virtual BOOL OnInitDialog();

    void DisableAll();

	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

public:
    DECLARE_INTERFACE_MAP()
    
    BEGIN_INTERFACE_PART(StateMonitor, IContextStateMonitor)
        STDMETHOD(StateChanged)(IContextState * state);
    END_INTERFACE_PART(StateMonitor)

public:
    afx_msg void OnDestroy();
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void ViewNone();
    afx_msg void ViewNonIdentity();
    afx_msg void ViewIdentity();
    afx_msg void ViewNew();
//    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnBnClickedSaveNew();
    afx_msg void OnBnClickedAbandonNew();
    afx_msg void OnLbnSelchangeListitems();
    afx_msg void OnBnClickedTbAttach();
    afx_msg void OnBnClickedTbView();
    afx_msg void OnBnClickedTbNote();
};
